package voiddme

import (
	"context"
	"log"
	"net/url"
	"os"

	registry2 "voiddme.io/engineering/pkg/voiddme/registry"
	transport2 "voiddme.io/engineering/pkg/voiddme/transport"
)

type Option func(o *options)

type options struct {
	id        string
	ctx       context.Context
	sigs      []os.Signal
	endpoints []*url.URL

	logger    *log.Logger
	registrar registry2.Registrar

	servers []transport2.Server
}

func ID(id string) Option {
	return func(o *options) {
		o.id = id
	}
}

func Server(srv ...transport2.Server) Option {
	return func(o *options) {
		o.servers = srv
	}
}

func Endpoint(endpoints ...*url.URL) Option {
	return func(o *options) {
		o.endpoints = endpoints
	}
}

func Logger(logger *log.Logger) Option {
	return func(o *options) {
		o.logger = logger
	}
}
